﻿using System.Windows;
using HandyControl.Tools;
using Microsoft.Extensions.DependencyInjection;
using Om.Core.Singleton;
using OptoMeasure.Extension;
using OptoMeasure.Views;
using Window = HandyControl.Controls.Window;

namespace OptoMeasure
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private DevicesConnectView _devicesConnectView;

        public MainWindow()
        {
            InitializeComponent();
            Title = DevicesConfig.Instance.AppName;
            _devicesConnectView = App.Current.ServiceProvider.GetRequiredService<DevicesConnectView>();

            this.Loaded+= OnLoaded;
        }

        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            //ButtonConfig_OnClick(this,null);
        }

        private void ButtonConfig_OnClick(object sender, RoutedEventArgs e)
        {
            var view = _devicesConnectView;
            view.ShowDialog("设备配置");
        }
    }
}